package com.iye.puretennis.activity.test;

import android.app.Activity;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.view.View;
import android.widget.Button;
import com.iye.puretennis.R;
import com.iye.puretennis.custom.MultiViewGroup;

/**
 * Author: Chuanbao on 2014/11/18.
 */
public class MultiScreenActivity extends Activity implements View.OnClickListener{
    private Button bt_scrollLeft;
    private Button bt_scrollRight;
    private MultiViewGroup mulTiViewGroup;

    public static int screenWidth  ;
    public static int scrrenHeight ;

    private int curscreen = 0;

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        DisplayMetrics metric = new DisplayMetrics();
        getWindowManager().getDefaultDisplay().getMetrics(metric);
        screenWidth = metric.widthPixels ;
        scrrenHeight = metric.heightPixels;
        System.out.println("screenWidth * scrrenHeight --->" + screenWidth + " * " +scrrenHeight);

        setContentView(R.layout.multiview);

        mulTiViewGroup = (MultiViewGroup)findViewById(R.id.mymultiViewGroup);

        bt_scrollLeft = (Button) findViewById(R.id.bt_scrollLeft);
        bt_scrollRight = (Button) findViewById(R.id.bt_scrollRight);

        bt_scrollLeft.setOnClickListener(this);
        bt_scrollRight.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        // TODO Auto-generated method stub

        switch (v.getId()) {
            case R.id.bt_scrollLeft:
                mulTiViewGroup.startMove() ;
                break;
            case R.id.bt_scrollRight:
                mulTiViewGroup.stopMove() ;
                break;
        }
    }

}